home *** CD-ROM | disk | FTP | other *** search
-
-
-
- SSSSIIIIGGGGNNNNAAAALLLL((((3333BBBB)))) SSSSIIIIGGGGNNNNAAAALLLL((((3333BBBB))))
-
-
-
- NNNNAAAAMMMMEEEE
- signal - simplified software signal facilities (4.3BSD)
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<ssssiiiiggggnnnnaaaallll....hhhh>>>>
-
- iiiinnnntttt ((((****ssssiiiiggggnnnnaaaallll((((iiiinnnntttt ssssiiiigggg,,,, iiiinnnntttt ((((****ffffuuuunnnncccc))))((((iiiinnnntttt,,,, ............))))))))))))((((iiiinnnntttt,,,, ............))));;;;
-
- To use any of the BSD signal routines (_k_i_l_l(3B), _k_i_l_l_p_g(3B),
- _s_i_g_b_l_o_c_k(3B), _s_i_g_n_a_l(3B), _s_i_g_p_a_u_s_e(3B), _s_i_g_s_e_t_m_a_s_k(3B), _s_i_g_s_t_a_c_k(2B),
- _s_i_g_v_e_c(3B)) you must either
-
- 1) #define ____BBBBSSSSDDDD____SSSSIIIIGGGGNNNNAAAALLLLSSSS or ____BBBBSSSSDDDD____CCCCOOOOMMMMPPPPAAAATTTT before including <_s_i_g_n_a_l._h>, or
-
- 2) specify one of them in the compile command or makefile:
-
- cc -D_BSD_SIGNALS -o prog prog.c
-
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _s_i_g_n_a_l is a simplified interface to the more general _s_i_g_v_e_c(3B) facility.
-
- A signal is generated by some abnormal event, initiated by a user at a
- terminal (quit, interrupt, stop), by a program error (bus error, etc.),
- by request of another program (kill), or when a process is stopped
- because it wishes to access its control terminal while in the background
- (see _t_e_r_m_i_o(7)). Signals are optionally generated when a process resumes
- after being stopped, when the status of child processes changes, or when
- input is ready at the control terminal. Most signals cause termination
- of the receiving process if no action is taken; some signals instead
- cause the process receiving them to be stopped, or are simply discarded
- if the process has not requested otherwise. Except for the SSSSIIIIGGGGKKKKIIIILLLLLLLL and
- SSSSIIIIGGGGSSSSTTTTOOOOPPPP signals, the _s_i_g_n_a_l call allows signals either to be ignored or
- to cause an interrupt to a specified location.
-
- For a list of valid signal numbers and a general description of the
- signal mechanism, please see _ssss_iiii_gggg_nnnn_aaaa_llll(5).
-
- If _f_u_n_c is SSSSIIIIGGGG____DDDDFFFFLLLL, the default action for signal _s_i_g is reinstated. If
- _f_u_n_c is SSSSIIIIGGGG____IIIIGGGGNNNN the signal is subsequently ignored and pending instances
- of the signal are discarded. Otherwise, when the signal occurs further
- occurrences of the signal are automatically blocked and _f_u_n_c is called.
-
- A return from the function unblocks the handled signal and continues the
- process at the point it was interrupted. Unlike the System V signal
- routine, the handler _f_u_n_c rrrreeeemmmmaaaaiiiinnnnssss iiiinnnnssssttttaaaalllllllleeeedddd after a signal has been
- delivered.
-
- SSSSIIIIGGGGKKKKIIIILLLLLLLL will immediately terminate a process, regardless of its state.
- Processes which are stopped via job control (typically <Ctrl>-Z) will not
- act upon any delivered signals other than SSSSIIIIGGGGKKKKIIIILLLLLLLL until the job is
- restarted. Processes which are blocked via a _b_l_o_c_k_p_r_o_c system call will
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- SSSSIIIIGGGGNNNNAAAALLLL((((3333BBBB)))) SSSSIIIIGGGGNNNNAAAALLLL((((3333BBBB))))
-
-
-
- unblock if they receive a signal which is fatal (i.e., a non-job-control
- signal which they are NOT catching), but will still be stopped if the job
- of which they are a part is stopped. Only upon restart will they die.
- Any non-fatal signals received by a blocked process will NOT cause the
- process to be unblocked (a call to _u_n_b_l_o_c_k_p_r_o_c(2) or _u_n_b_l_o_c_k_p_r_o_c_a_l_l(2) is
- necessary).
-
- The value of _s_i_g_n_a_l is the previous (or initial) value of _f_u_n_c for the
- particular signal.
-
- After a _f_o_r_k(2) the child inherits all handlers and signal masks, but not
- the set of pending signals.
-
- The _e_x_e_c(2) routines reset all caught signals to the default action;
- ignored signals remain ignored, the blocked signal mask is unchanged and
- pending signals remain pending.
-
- RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
- The previous action is returned on a successful call. Otherwise, -1 is
- returned and _e_r_r_n_o is set to indicate the error.
-
- EEEERRRRRRRROOOORRRRSSSS
- _s_i_g_n_a_l will fail and no action will take place if one of the following
- occur:
-
- [EINVAL] _S_i_g is not a valid signal number.
-
- [EINVAL] An attempt is made to ignore or supply a handler for
- SSSSIIIIGGGGKKKKIIIILLLLLLLL or SSSSIIIIGGGGSSSSTTTTOOOOPPPP.
-
- [EINVAL] An attempt is made to ignore SSSSIIIIGGGGCCCCOOOONNNNTTTT (by default SSSSIIIIGGGGCCCCOOOONNNNTTTT
- is ignored).
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- kill(3B), sigvec(3B), sigblock(3B), sigsetmask(3B), sigpause(3B),
- setjmp(3), blockproc(2), signal(5).
-
- CCCCAAAAVVVVEEEEAAAATTTTSSSS ((((IIIIRRRRIIIIXXXX))))
- 4.2BSD attempts to restart system calls which are interrupted by signal
- receipt; 4.3BSD gives the programmer a choice of restart or failed-
- return-with-error via the SSSSVVVV____IIIINNNNTTTTEEEERRRRRRRRUUUUPPPPTTTT flag in _s_i_g_v_e_c or use of the
- _s_i_g_i_n_t_e_r_r_u_p_t library routine. IRIX provides _o_n_l_y the fail-with-error
- option. The affected system calls are _r_e_a_d(2), _w_r_i_t_e(2), _o_p_e_n(2),
- _i_o_c_t_l(2), and _w_a_i_t(2). Refer to the _s_i_g_s_e_t(2) man page for a more
- detailed description of the behavior.
-
- Because 4.3BSD and System V both have _s_i_g_n_a_l system calls, programs using
- 4.3BSD's version are actually executing _B_S_D_s_i_g_n_a_l. This is transparent
- to the programmer except when attempting to set breakpoints in ddddbbbbxxxx; the
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- SSSSIIIIGGGGNNNNAAAALLLL((((3333BBBB)))) SSSSIIIIGGGGNNNNAAAALLLL((((3333BBBB))))
-
-
-
- breakpoint must be set at _B_S_D_s_i_g_n_a_l.
-
- WWWWAAAARRRRNNNNIIIINNNNGGGG ((((IIIIRRRRIIIIXXXX))))
- The 4.3BSD and System V signal facilities have different semantics.
- Using both facilities in the same program is ssssttttrrrroooonnnnggggllllyyyy ddddiiiissssccccoooouuuurrrraaaaggggeeeedddd and
- will result in unpredictable behavior.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-